using System;
using System.Drawing;

namespace WebChart
{
	public class XLineMarker : LineMarker
	{
		// Fields
		private Brush brush;
		private Pen pen;

		// Methods
		public XLineMarker()
		{
			this.brush = null;
			this.pen = null;
		}

		public XLineMarker(int size, Color color, Color borderColor) : base(size, color, borderColor)
		{
			this.brush = null;
			this.pen = null;
		}

		public override void Render(Graphics graphics, int x, int y)
		{
			int num = base.Size / 2;
			int num2 = x - num;
			int num3 = x + num;
			int num4 = y - num;
			int num5 = y + num;
			int num6 = base.Size / 5;
			int num7 = 2 * num6;
			if (num6 <= 0)
			{
				num6 = 1;
				base.Size = 5;
			}
			Point[] points = new Point[] { new Point(num2, num4 + num6), new Point(num2 + num6, num4), new Point(x, num4 + num7), new Point(num3 - num6, num4), new Point(num3, num4 + num6), new Point(num3 - num7, y), new Point(num3, num5 - num6), new Point(num3 - num6, num5), new Point(x, num5 - num7), new Point(num2 + num6, num5), new Point(num2, num5 - num6), new Point(num2 + num7, y) };
			graphics.FillPolygon(this.Brush, points);
			graphics.DrawPolygon(this.Pen, points);
		}

		// Properties
		private Brush Brush
		{
			get
			{
				if (this.brush == null)
				{
					this.brush = new SolidBrush(base.Color);
				}
				return this.brush;
			}
		}

		private Pen Pen
		{
			get
			{
				if (this.pen == null)
				{
					this.pen = new Pen(base.BorderColor, 0f);
				}
				return this.pen;
			}
		}
	}
}
